<template>
	<view class="page">
		<view v-html="content" class="detail_content" />
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import request from '@/utils/common/request/index';
	import { onLoad } from '@dcloudio/uni-app';
	import formatRichText from '@/utils/common/richText.js';

	let article_id = '';
	let title = '';
	onLoad(options => {
		article_id = options.id;
		title = options.title;
		getContent();
	})

	const { imgHost } = getApp().globalData;
	let content = ref('');
	const getContent = () => {
		request({
			url: `/api/aboutuse?set_id=${article_id}`,
			loadingTip: '加载中'
		}).then(res => {
			content.value = formatRichText(res.content);
			uni.setNavigationBarTitle({
				title
			});
		})
	};
</script>

<style scoped lang="scss">
	.detail_content {
		padding-bottom: 10px;
		word-wrap: break-word;
		word-break: break-word;
		white-space: normal !important;
	}
</style>